<?php
include("../lib/template.inc");
include("../lib/lib_online_payment.php");
include("../nav_data.php");
$m=0;

$user=get_current_user_obj();
$receiver=new receiver($user->epsn,$user->user_ID);
$payment=new payment($_POST["pay_info"]);

if(islogedin())
	if($receiver->receive($payment))
	{
		$doc[$m]["title"]="收款成功";
		$doc[$m]["content"]='来自'.$payment->payer->realname.'的'.$payment->amount.'元已经接收，现在已存入您的Cacomand账户中。';
		$doc[$m]["wid"]='100%';
	}
	else
	{
		$doc[$m]["title"]="收款失败";
		$doc[$m]["content"]='这笔款项当前还不能接收。';
		$doc[$m]["wid"]='100%';
	}
else
{
	$doc[$m]["title"]="网上收款";
	$doc[$m]["content"]='您尚未登录，请您点击<a href="../user_login.php">这里</a>登录';
	$doc[$m]["wid"]='100%';
}	
	
include("render.php");
render("网上付款",$nav_title,$nav_link,$doc);
?>